//go:build !embed
// +build !embed

package fs

import (
	"fmt"
	"io/fs"
	"os"
)

type myfs struct {
}

type myf struct {
	file *os.File
}

func (m *myf) Stat() (fs.FileInfo, error) {
	return m.file.Stat()
}
func (m *myf) Read(b []byte) (int, error) {
	return m.file.Read(b)
}
func (m *myf) Close() error {
	return m.file.Close()
}

var FS *myfs

func (f *myfs) Open(name string) (fs.File, error) {
	name = fmt.Sprintf("./fs/pages/%s", name)
	file, err := os.Open(name)
	return &myf{file: file}, err
}

func (f *myfs) ReadDir(name string) ([]fs.DirEntry, error) {
	return nil, nil
}
func (f *myfs) ReadFile(name string) ([]byte, error) {
	return os.ReadFile(fmt.Sprintf("./fs/pages/%s", name))
}
